package com.qiaofang.applet.service.member.service.mapstruct;

import com.qiaofang.applet.service.member.domain.EmployeeReport;
import com.qiaofang.applet.service.member.service.dto.EmployeeDailyDto;
import org.apache.commons.lang3.StringUtils;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

/**
 * @Author: youqing.yang
 * @Create: 2021/03/29 11:46
 * @Description:
 **/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface EmployeeReportMapper {

    default EmployeeDailyDto domainToDto(EmployeeReport employeeReport){
        if (employeeReport == null) {
            return null;
        }

        EmployeeDailyDto employeeDailyDto = new EmployeeDailyDto();

        employeeDailyDto.setCompanyUuid(employeeReport.getCompanyUuid());
        employeeDailyDto.setEmployeeUniqueUuid(employeeReport.getEmployeeUniqueUuid());
        employeeDailyDto.setShares(employeeReport.getShareNum());
        employeeDailyDto.setClients(employeeReport.getInteractNum());
        employeeDailyDto.setBrowses(employeeReport.getVisitNum());
        employeeDailyDto.setChats(employeeReport.getChatNum());
        employeeDailyDto.setDeptUuid(employeeReport.getDeptUuid());
        employeeDailyDto.setEmployeeName(employeeReport.getEmployeeName());
        return employeeDailyDto;
    }
}
